<template>
    <div class="xunjingwendao order-list">
        <Navbar :activeMenu="currentPath" />
        <div class="main container">
            <!-- :backgroundColor="backgroundColor" -->



            <!--内容区 -->
            <div class="tang-feng-block">
                <!-- 用户数据块 -->
                <div class="tang-feng-data">

                    <!-- 地址信息 -->
                    <div class="detailitem detail-address">
                        <div class="top">
                            <u-icon name="map" color="#2979ff" size="28"></u-icon>
                            {{ details.orderLogistics.userName }}

                            {{ details.orderLogistics.telNum }}
                        </div>
                        <div class="address">地址：{{ details.orderLogistics.address }}</div>
                    </div>
                    <!-- 商品信息 -->
                    <div class="detailitem shopBox">
                        <div class="item" v-for="(item, index) in details.listOrderItem" :key="index">
                            <img :src="item.picUrl" mode="widthFix" />
                            <div class="conBox">
                                <div class="conBox-1">{{ item.spuName }}</div>

                                <div class="conBox-3">¥ {{ item.paymentPrice }}</div>
                                <div class="number">数量<span style="padding-left: 15px;">{{ item.quantity }}</span></div>
                            </div>

                        </div>
                    </div>
                    <!-- 订单信息 -->
                    <div class="detailitem orderItem">
                        <div class="orderItem-min">
                            <div class="orderItem-1">订单编号：</div>
                            <div class="orderItem-2" @click="copyText(details.orderNo)">{{ details.orderNo }}</div>

                        </div>
                        <div class="orderItem-min">
                            <div class="orderItem-1">下单时间：</div>
                            <div class="orderItem-2">{{ details.createTime }}</div>
                        </div>
                        <div class="orderItem-min">
                            <div class="orderItem-1">配送方式：</div>
                            <div class="orderItem-2">快递免邮费</div>
                        </div>
                        <div class="orderItem-min">
                            <div class="orderItem-1">买家留言：</div>
                            <div class="orderItem-2">{{ details.userMessage }}</div>
                        </div>

                    </div>
                    <!-- 订单信息 -->
                    <div class="detailitem orderItem" style="margin-bottom: 100px;">
                        <div class="orderItem-min orderInfo">
                            <div class="orderItem-1">商品总额</div>
                            <div class="orderItem-2">¥ {{ details.paymentPrice }}</div>
                        </div>

                        <div class="orderItem-min orderInfo" style="border-bottom: 2px solid rgba(0,0,0,0)">
                            <div class="orderItem-1"></div>
                            <div class="orderItem-2">实付款：<span style="color: red;"> ¥{{ details.paymentPrice }}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 底部按钮 -->
        </div>

    </div>
</template>

<script>
import { orderinfoDetails } from '@/api/index'
export default {
    computed: {
        currentPath() {
            return '/shop'; // 获取当前路由路径
        },
    },
    data() {
        return {
            backgroundColor: 0,
            nav_opacity: 'rgba(255,255,255,0)',
            fontColor: '#ffffff',
            details: {}
        }
    },

    mounted(e) {
        let id = this.$route.query.id;
        this.getData(id)
    },
    methods: {
        getData(id) {
            orderinfoDetails(id).then((res) => {
                console.log(res)
                this.details = res.data;
            })
        },
        clickLeft() {
            uni.navigateBack({
                delta: 1
            })
        },
        /**
         * @function 复制功能
         */
        copyText(msg) {
            uni.setClipboardData({
                data: msg,
                success: () => {
                    uni.showToast({
                        title: "已复制订单编号",
                        icon: 'none'
                    })
                },
                fail: () => {

                }
            });

        }
    }
}
</script>

<style lang="scss">
.content {
    color: #010101;
    font: normal 14px/2.2 Arial, Verdana, Tahoma, sans-serif;
    background-color: #F5F5F5;
}

.tang-feng-bg {
    width: 100%;
    height: 700px;
    position: relative;
    background: linear-gradient(to top, #ffffff, #0000ff);
}

.tang-feng-block {
    padding: 20px;
    box-sizing: border-box;

    position: relative;
    z-index: 3;

    .tang-feng-data {
        border-radius: 12px;
        margin-bottom: 20px;

        .detail-top {
            width: 100%;
            margin-bottom: 20px;

            .detail-top-1 {
                color: #ffffff;
                font-weight: bold;
                font-size: 16px;
                display: flex;
                align-items: center;
                justify-content: center;

                image {
                    width: 70px;
                    height: 65px;
                    margin-right: 10px;
                }
            }

            .detail-top-2 {
                color: #ffffff;
                font-size: 14px;
                text-align: center;
                letter-spacing: 3px;
            }
        }

        .detailitem {
            background-color: #ffffff;
            border-radius: 20px;
            box-shadow: 0 0upx 6upx 0upx rgba(0, 0, 150, .2);
            margin-bottom: 20px;
            padding: 20px;
            box-sizing: border-box;
        }

        .detail-address {
            .top {
                font-weight: bold;
                letter-spacing: 3px;
                font-size: 14px;
                display: flex;
                align-items: center;

                image {
                    width: 40px;
                    height: 40px;
                    margin-right: 10px;
                }
            }

            .address {
                color: rgba(0, 0, 0, .7);
                margin-top: 15px;
            }
        }

        .shopBox {

            // height: 200px;
            .item {
                display: flex;

                align-items: center;
                margin-bottom: 20px;

                img {
                    width: 200px;
                    height: 200px;
                    border-radius: 10px;
                }

                .conBox {
                    flex: 1;
                    min-height: 200px;
                    padding: 10px 20px;
                    box-sizing: border-box;
                    border-bottom: 2px solid #f3f3f3;

                    .conBox-1 {
                        font-size: 13px;
                        font-weight: bold;
                    }

                    .conBox-2 {
                        font-size: 13px;
                        font-weight: bold;
                        color: rgba(0, 0, 0, .7);
                    }

                    .conBox-3 {
                        font-size: 14px;
                        font-weight: bold;
                        color: red;
                    }
                }

                .number {
                    font-size: 12px;
                    color: rgba(124, 113, 113, 0.7);
                    margin-top: 10px;
                }
            }
        }

        .orderItem {
            .orderItem-min {
                width: 100%;
                display: flex;
                align-items: center;
                letter-spacing: 4px;
                border-bottom: 2px solid #f3f3f3;
                padding: 15px 0;
                font-size: 14px;

                .orderItem-1 {
                    width: 106px;
                    color: rgba(0, 0, 0, .7);
                }

                .orderItem-2 {
                    color: #000000;
                    font-weight: bold;
                    margin-right: 20px;
                }

                .orderItem-3 {
                    padding: 0px 20px;
                    box-sizing: border-box;
                    border-radius: 10px;
                    background-color: #eeeeee;
                }
            }

            .orderInfo {
                justify-content: space-between;
            }
        }
    }
}

.bottomBox {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    /* 设置边框 */
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
    /* 设置阴影 */
    width: 750px;
    height: 140px;
    position: fixed;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    letter-spacing: 5px;

    .leftTxt {
        color: #e55239;
        font-size: 20px;
        font-weight: bold;
    }

    .gnBox {
        height: 100%;
        display: flex;
        align-items: center;

        .item {
            // width: 70px;
            background-color: #e55239;
            color: #ffffff;
            padding: 0px 20px;
            box-sizing: border-box;
            margin-left: 15px;
            border-radius: 10px;
        }

        .zhun {
            background-color: #e55239;
        }

        .jie {
            background-color: #6b5ef8;
        }

        .lianxi {
            background-color: #51baad;
        }
    }
}
</style>